import { createApp } from 'vue';

import 'vant/lib/toast/index.css'; // 引入vant的toast样式
import 'amfe-flexible';
import Vconsole from 'vconsole';
import 'virtual:svg-icons-register'; // svg注册器

import '@/styles/index.scss';
import App from '@/App.vue';
import components from '@/components/index'; // 自定义全局组件
import directives from '@/directives/index'; // 自定义全局指令
import router from '@/router/index';
import { setupStore } from '@/store/index';

// 创建App实例
let app: any = null;
const vConsole: any = new Vconsole();
const render = () => {
  app = createApp(App);
  setupStore(app);
  app
    .use(router)
    .use(directives)
    .use(components)
    .use(vConsole)
    .mount(document.getElementById('app'));
};

render();
